home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Professional Soft Collection 1.02
/
Professional Soft Collection 1.02.iso
/
bonusrus.os2
/
infohway.cmd
< prev
next >
Wrap
OS/2 REXX Batch file
|
1995-05-16
|
4KB
|
145 lines
/* **********************************************************************
* * Copyright (c) IBM Corporation, 1994 *
* * All Rights Reserved *
* **********************************************************************
*
* IBM OS/2 Information Highway Desktop Setup Utility
*/
/* Initalize Environment:
* This command file combines all internet access applications on
* the BonusPak for OS/2 into one workplace shell folder.
*/
'@echo off'
trace off
/* Parse Call Path Info
*/
Parse Source . . callPath
/* Load in function library
*/
Call RxFuncAdd "SysLoadFuncs","RexxUtil","SysLoadFuncs"
Call SysLoadFuncs
/* Strip program name
*/
rcp = REVERSE(callPath)
callPathDir = REVERSE(substr(rcp,POS("\",rcp)+1))
/* Create Queue to catch system error messages
*/
rcode = RXQUEUE('delete', errq)
errq = RXQUEUE('create')
new = RXQUEUE('set', errq)
/* Setup global variables
*/
GV.InfoHwyIconText = "IBM Information"||"0D0A"X||"Superhighway"
GV.InfoHwyObjectID = "<InfoHighway>"
GV.InfoHwyLocation = "<WP_DESKTOP>"
GV.ObjectID.0 = 3
GV.ObjectID.1 = "<SampleApp>" /* OS/2-CIM */
GV.ObjectID.2 = "<FPW_HALITE>" /* HyperACCESS */
GV.ObjectID.3 = "<IAK>" /* Internet: After Reboot */
/* Define stem of icon files to be copied
*/
MaxCopyIndex = 4
Files. = ""
Files.0 = MaxCopyIndex
Files.1 = "INFOHWY1.ICO"
Files.2 = "INFOHWY2.ICO"
Files.3 = "INET1.ICO"
Files.4 = "INET2.ICO"
/* Verify Source Files
*/
do i = 1 to MaxCopyIndex
rc = VerifySourcePath( callPathDir||'\'||Files.i )
if ( rc == 1 ) then
call Done
end
/* Is a SuperHighway folder needed?
* Are any of the SuperHighway applications installed?
*/
fSH_Appl_Exists = 0
do z = 1 to GV.ObjectID.0
rc = ObjectExists(GV.ObjectID.z)
fSH_Appl_Exists = fSH_Appl_Exists + rc
end
if (fSH_Appl_Exists == 0) then
signal Done
/* Create Information Highway Folder
*/
classname = 'WPFolder'
title = GV.InfoHwyIconText
location = GV.InfoHwyLocation
setup = 'OBJECTID='GV.InfoHwyObjectID';'||,
'ICONFILE='||callPathDir||'\'||Files.3||';'||,
'ICONNFILE=1,'||callPathDir||'\'||Files.4||';'
rc = SysCreateObject(classname, title, location, setup, 'f')
/* Move Information Highway Applications to Information Highway Folder
*/
do z = 1 to GV.ObjectID.0
rc = SysMoveObject(GV.ObjectID.z,GV.InfoHwyObjectID)
end
/* Open Information Highway Folder
*/
object = GV.InfoHwyObjectID
setup = 'OPEN=DEFAULT'
rc = SysSetObjectData(object, setup)
Done:
rc = RXQUEUE('delete', errq)
exit
/* Procedures and Functions
*/
VerifySourcePath: Procedure Expose errq
Parse Arg file;
fExists = Stream(file,'c','query exists')
if (fExists == "")
then do
'helpmsg SYS002 | RXQUEUE 'errq
call DumpErrMsg
return 1
end
return 0
DumpErrMsg: Procedure
do while(QUEUED() \= 0)
parse pull line
if (POS("SYS",line) \= 0) then
fFound = 1
if ((line == "") & (fFound = 1)) then
do
/* Empty out queue
*/
do while(QUEUED() \= 0)
parse pull line
end
leave
end
say line
end
return
ObjectExists: procedure
parse arg Object
rc = SysSetObjectData(Object,"NODELETE=NO")
return rc